/*
    GASON: SQLmap Wrapper for Burpsuite.
    Copyright (C) 2011-2012  Daniel Garcia (cr0hn) | dani@iniqua.com | twitter: @ggdaniel
    Project page: http://code.google.com/p/gason/

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

/*
 * Dialog_param.java
 *
 * Created on 27-feb-2012, 15:37:36
 */

package CustomPlugin.sqlmap;

/**
 *
 * @author Daniel Garcia Garcia (cr0hn) - dani@iniqua.com
 */
public class Dialog_param extends javax.swing.JDialog {
    public String param_name;
    public String param_value;

    /** Creates new form Dialog_param */
    public Dialog_param(String param_name_, String param_value_, java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();

        this.param_name = param_name_;
        this.param_value = param_value_;

        this.txt_param_name.setText(this.param_name);
        this.txt_param_value.setText(this.param_value);
        this.setLocationRelativeTo(null);
        this.getRootPane().setDefaultButton(this.btn_accept);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        btn_accept = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txt_param_name = new javax.swing.JTextField();
        txt_param_value = new javax.swing.JTextField();
        btn_cancel = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();

        setTitle("Modify parameter");
        setModal(true);

        jPanel1.setLayout(null);

        btn_accept.setText("Accept");
        btn_accept.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_acceptActionPerformed(evt);
            }
        });
        jPanel1.add(btn_accept);
        btn_accept.setBounds(250, 50, 81, 20);

        jLabel1.setText("Param name");
        jPanel1.add(jLabel1);
        jLabel1.setBounds(10, 0, 76, 15);

        jLabel3.setText("Param value");
        jPanel1.add(jLabel3);
        jLabel3.setBounds(160, 0, 75, 15);
        jPanel1.add(txt_param_name);
        txt_param_name.setBounds(10, 20, 120, 20);
        jPanel1.add(txt_param_value);
        txt_param_value.setBounds(160, 20, 170, 19);

        btn_cancel.setText("Cancel");
        btn_cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_cancelActionPerformed(evt);
            }
        });
        jPanel1.add(btn_cancel);
        btn_cancel.setBounds(160, 50, 75, 20);

        jLabel2.setText("=");
        jPanel1.add(jLabel2);
        jLabel2.setBounds(140, 20, 10, 15);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btn_acceptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_acceptActionPerformed
        this.param_name = txt_param_name.getText();
        this.param_value = txt_param_value.getText();
        this.setVisible(false);
}//GEN-LAST:event_btn_acceptActionPerformed

    private void btn_cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_cancelActionPerformed
        this.setVisible(false);
        dispose();
}//GEN-LAST:event_btn_cancelActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_accept;
    private javax.swing.JButton btn_cancel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField txt_param_name;
    private javax.swing.JTextField txt_param_value;
    // End of variables declaration//GEN-END:variables

}
